<%@page import="org.apache.commons.lang3.StringUtils"%>
<%@page import="com.powroznik.tracker.engine.services.Account"%>
<%@page import="com.powroznik.tracker.engine.services.User"%>
<%@page import="com.powroznik.tracker.liferay.portlet.Client"%>

<%@ taglib prefix="aui" uri="http://liferay.com/tld/aui"%>
<%@ taglib prefix="portlet" uri="http://java.sun.com/portlet_2_0"%>

<portlet:defineObjects />

<portlet:actionURL var="viewURL">
	<portlet:param name="jspPage" value="/html/accountportlet/view.jsp" />
</portlet:actionURL>

<%
	Client client = Client.getInstance(request);
	client.setUserKey(renderRequest.getRemoteUser());
	Account account = client.getAccount();

	String name = renderRequest.getParameter("name");
	if (name == null && account != null) {
		name = account.getName();
	}
	String country = renderRequest.getParameter("country");
	if (country == null && account != null) {
		country = account.getCountry();
	}
	if (StringUtils.isNotBlank(name) && StringUtils.isNotBlank(country)) {
		if (account == null) {
			account = new Account();
			account.setName(name);
			account.setCountry(country);
			client.registerNewAccount(account);
		} else {
			account.setName(name);
			account.setCountry(country);
			client.updateAccount(account);
		}
	}
%>

<%
	if (account == null) {
%>

<p>Your user does not appear to be linked to any account. In order
	to use all features of this application, you first need to register
	your account.</p>

<%
	}
%>

<aui:form action="<%=viewURL%>" method="post">
	<aui:layout>
		<aui:column>
			<aui:input label="Name (*)" name="name" type="text"
				value="<%=account != null ? account.getName() : null%>" />
			<aui:select label="Country (*)" name="country">
				<option<%=account == null || StringUtils.isBlank(account.getCountry()) ? " selected=\"true\"" : ""%> />
				<option label="Afghanistan" value="AF"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "AF") ? " selected=\"true\"" : ""%> />
				<option label="Albania" value="AL"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "AL") ? " selected=\"true\"" : ""%> />
				<option label="Algeria" value="DZ"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "DZ") ? " selected=\"true\"" : ""%> />
				<option label="American Samoa" value="AS"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "AS") ? " selected=\"true\"" : ""%> />
				<option label="Andorra" value="AD"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "AD") ? " selected=\"true\"" : ""%> />
				<option label="Angola" value="AO"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "AO") ? " selected=\"true\"" : ""%> />
				<option label="Anguilla" value="AI"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "AI") ? " selected=\"true\"" : ""%> />
				<option label="Antarctica" value="AQ"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "AQ") ? " selected=\"true\"" : ""%> />
				<option label="Antigua & Barbuda" value="AG"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "AG") ? " selected=\"true\"" : ""%> />
				<option label="Antilles, Netherlands" value="AN"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "AN") ? " selected=\"true\"" : ""%> />
				<option label="Arabia, Saudi" value="SA"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "SA") ? " selected=\"true\"" : ""%> />
				<option label="Argentina" value="AR"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "AR") ? " selected=\"true\"" : ""%> />
				<option label="Armenia" value="AM"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "AM") ? " selected=\"true\"" : ""%> />
				<option label="Aruba" value="AW"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "AW") ? " selected=\"true\"" : ""%> />
				<option label="Australia" value="AU"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "AU") ? " selected=\"true\"" : ""%> />
				<option label="Austria" value="AT"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "AT") ? " selected=\"true\"" : ""%> />
				<option label="Azerbaijan" value="AZ"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "AZ") ? " selected=\"true\"" : ""%> />
				<option label="Bahamas, The" value="BS"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "BS") ? " selected=\"true\"" : ""%> />
				<option label="Bahrain" value="BH"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "BH") ? " selected=\"true\"" : ""%> />
				<option label="Bangladesh" value="BD"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "BD") ? " selected=\"true\"" : ""%> />
				<option label="Barbados" value="BB"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "BB") ? " selected=\"true\"" : ""%> />
				<option label="Belarus" value="BY"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "BY") ? " selected=\"true\"" : ""%> />
				<option label="Belgium" value="BE"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "BE") ? " selected=\"true\"" : ""%> />
				<option label="Belize" value="BZ"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "BZ") ? " selected=\"true\"" : ""%> />
				<option label="Benin" value="BJ"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "BJ") ? " selected=\"true\"" : ""%> />
				<option label="Bermuda" value="BM"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "BM") ? " selected=\"true\"" : ""%> />
				<option label="Bhutan" value="BT"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "BT") ? " selected=\"true\"" : ""%> />
				<option label="Bolivia" value="BO"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "BO") ? " selected=\"true\"" : ""%> />
				<option label="Bosnia and Herzegovina" value="BA"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "BA") ? " selected=\"true\"" : ""%> />
				<option label="Botswana" value="BW"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "BW") ? " selected=\"true\"" : ""%> />
				<option label="Bouvet Island" value="BV"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "BV") ? " selected=\"true\"" : ""%> />
				<option label="Brazil" value="BR"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "BR") ? " selected=\"true\"" : ""%> />
				<option label="British Indian Ocean T." value="IO"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "IO") ? " selected=\"true\"" : ""%> />
				<option label="British Virgin Islands" value="VG"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "VG") ? " selected=\"true\"" : ""%> />
				<option label="Brunei Darussalam" value="BN"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "BN") ? " selected=\"true\"" : ""%> />
				<option label="Bulgaria" value="BG"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "BG") ? " selected=\"true\"" : ""%> />
				<option label="Burkina Faso" value="BF"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "BF") ? " selected=\"true\"" : ""%> />
				<option label="Burundi" value="BI"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "BI") ? " selected=\"true\"" : ""%> />
				<option label="Cambodia" value="KH"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "KH") ? " selected=\"true\"" : ""%> />
				<option label="Cameroon" value="CM"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "CM") ? " selected=\"true\"" : ""%> />
				<option label="Canada" value="CA"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "CA") ? " selected=\"true\"" : ""%> />
				<option label="Cape Verde" value="CV"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "CV") ? " selected=\"true\"" : ""%> />
				<option label="Cayman Islands" value="KY"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "KY") ? " selected=\"true\"" : ""%> />
				<option label="Central African Republic" value="CF"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "CF") ? " selected=\"true\"" : ""%> />
				<option label="Chad" value="TD"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "TD") ? " selected=\"true\"" : ""%> />
				<option label="Chile" value="CL"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "CL") ? " selected=\"true\"" : ""%> />
				<option label="China" value="CN"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "CN") ? " selected=\"true\"" : ""%> />
				<option label="Christmas Island" value="CX"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "CX") ? " selected=\"true\"" : ""%> />
				<option label="Cocos (Keeling) Islands" value="CC"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "CC") ? " selected=\"true\"" : ""%> />
				<option label="Colombia" value="CO"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "CO") ? " selected=\"true\"" : ""%> />
				<option label="Comoros" value="KM"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "KM") ? " selected=\"true\"" : ""%> />
				<option label="Congo" value="CG"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "CG") ? " selected=\"true\"" : ""%> />
				<option label="Congo, Dem. Rep. of the" value="CD"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "CD") ? " selected=\"true\"" : ""%> />
				<option label="Cook Islands" value="CK"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "CK") ? " selected=\"true\"" : ""%> />
				<option label="Costa Rica" value="CR"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "CR") ? " selected=\"true\"" : ""%> />
				<option label="Cote D'Ivoire" value="CI"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "CI") ? " selected=\"true\"" : ""%> />
				<option label="Croatia" value="HR"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "HR") ? " selected=\"true\"" : ""%> />
				<option label="Cuba" value="CU"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "CU") ? " selected=\"true\"" : ""%> />
				<option label="Cyprus" value="CY"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "CY") ? " selected=\"true\"" : ""%> />
				<option label="Czech Republic" value="CZ"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "CZ") ? " selected=\"true\"" : ""%> />
				<option label="Denmark" value="DK"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "DK") ? " selected=\"true\"" : ""%> />
				<option label="Djibouti" value="DJ"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "DJ") ? " selected=\"true\"" : ""%> />
				<option label="Dominica" value="DM"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "DM") ? " selected=\"true\"" : ""%> />
				<option label="Dominican Republic" value="DO"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "DO") ? " selected=\"true\"" : ""%> />
				<option label="East Timor (Timor-Leste)" value="TP"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "TP") ? " selected=\"true\"" : ""%> />
				<option label="Ecuador" value="EC"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "EC") ? " selected=\"true\"" : ""%> />
				<option label="Egypt" value="EG"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "EG") ? " selected=\"true\"" : ""%> />
				<option label="El Salvador" value="SV"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "SV") ? " selected=\"true\"" : ""%> />
				<option label="Equatorial Guinea" value="GQ"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "GQ") ? " selected=\"true\"" : ""%> />
				<option label="Eritrea" value="ER"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "ER") ? " selected=\"true\"" : ""%> />
				<option label="Estonia" value="EE"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "EE") ? " selected=\"true\"" : ""%> />
				<option label="Ethiopia" value="ET"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "ET") ? " selected=\"true\"" : ""%> />
				<option label="European Union" value="EU"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "EU") ? " selected=\"true\"" : ""%> />
				<option label="Falkland Islands (Malvinas)" value="FK"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "FK") ? " selected=\"true\"" : ""%> />
				<option label="Faroe Islands" value="FO"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "FO") ? " selected=\"true\"" : ""%> />
				<option label="Fiji" value="FJ"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "FJ") ? " selected=\"true\"" : ""%> />
				<option label="Finland" value="FI"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "FI") ? " selected=\"true\"" : ""%> />
				<option label="France" value="FR"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "FR") ? " selected=\"true\"" : ""%> />
				<option label="French Guiana" value="GF"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "GF") ? " selected=\"true\"" : ""%> />
				<option label="French Polynesia" value="PF"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "PF") ? " selected=\"true\"" : ""%> />
				<option label="French Southern Terr." value="TF"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "TF") ? " selected=\"true\"" : ""%> />
				<option label="Gabon" value="GA"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "GA") ? " selected=\"true\"" : ""%> />
				<option label="Gambia, the" value="GM"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "GM") ? " selected=\"true\"" : ""%> />
				<option label="Georgia" value="GE"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "GE") ? " selected=\"true\"" : ""%> />
				<option label="Germany" value="DE"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "DE") ? " selected=\"true\"" : ""%> />
				<option label="Ghana" value="GH"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "GH") ? " selected=\"true\"" : ""%> />
				<option label="Gibraltar" value="GI"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "GI") ? " selected=\"true\"" : ""%> />
				<option label="Greece" value="GR"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "GR") ? " selected=\"true\"" : ""%> />
				<option label="Greenland" value="GL"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "GL") ? " selected=\"true\"" : ""%> />
				<option label="Grenada" value="GD"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "GD") ? " selected=\"true\"" : ""%> />
				<option label="Guadeloupe" value="GP"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "GP") ? " selected=\"true\"" : ""%> />
				<option label="Guam" value="GU"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "GU") ? " selected=\"true\"" : ""%> />
				<option label="Guatemala" value="GT"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "GT") ? " selected=\"true\"" : ""%> />
				<option label="Guernsey and Alderney" value="GG"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "GG") ? " selected=\"true\"" : ""%> />
				<option label="Guiana, French" value="GF"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "GF") ? " selected=\"true\"" : ""%> />
				<option label="Guinea" value="GN"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "GN") ? " selected=\"true\"" : ""%> />
				<option label="Guinea, Equatorial" value="GP"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "GP") ? " selected=\"true\"" : ""%> />
				<option label="Guinea-Bissau" value="GW"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "GW") ? " selected=\"true\"" : ""%> />
				<option label="Guyana" value="GY"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "GY") ? " selected=\"true\"" : ""%> />
				<option label="Haiti" value="HT"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "HT") ? " selected=\"true\"" : ""%> />
				<option label="Heard & McDonald Is.(AU)" value="HM"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "HM") ? " selected=\"true\"" : ""%> />
				<option label="Holy See (Vatican)" value="VA"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "VA") ? " selected=\"true\"" : ""%> />
				<option label="Honduras" value="HN"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "HN") ? " selected=\"true\"" : ""%> />
				<option label="Hong Kong, (China)" value="HK"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "HK") ? " selected=\"true\"" : ""%> />
				<option label="Hungary" value="HU"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "HU") ? " selected=\"true\"" : ""%> />
				<option label="Iceland" value="IS"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "IS") ? " selected=\"true\"" : ""%> />
				<option label="India" value="IN"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "IN") ? " selected=\"true\"" : ""%> />
				<option label="Indonesia" value="ID"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "ID") ? " selected=\"true\"" : ""%> />
				<option label="Iran, Islamic Republic of" value="IR"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "IR") ? " selected=\"true\"" : ""%> />
				<option label="Iraq" value="IQ"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "IQ") ? " selected=\"true\"" : ""%> />
				<option label="Ireland" value="IE"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "IE") ? " selected=\"true\"" : ""%> />
				<option label="Israel" value="IL"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "IL") ? " selected=\"true\"" : ""%> />
				<option label="Italy" value="IT"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "IT") ? " selected=\"true\"" : ""%> />
				<option label="Ivory Coast (Cote d'Ivoire)" value="CI"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "CI") ? " selected=\"true\"" : ""%> />
				<option label="Jamaica" value="JM"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "JM") ? " selected=\"true\"" : ""%> />
				<option label="Japan" value="JP"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "JP") ? " selected=\"true\"" : ""%> />
				<option label="Jersey" value="JE"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "JE") ? " selected=\"true\"" : ""%> />
				<option label="Jordan" value="JO"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "JO") ? " selected=\"true\"" : ""%> />
				<option label="Kazakhstan" value="KZ"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "KZ") ? " selected=\"true\"" : ""%> />
				<option label="Kenya" value="KE"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "KE") ? " selected=\"true\"" : ""%> />
				<option label="Kiribati" value="KI"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "KI") ? " selected=\"true\"" : ""%> />
				<option label="Korea Dem. People's Rep." value="KP"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "KP") ? " selected=\"true\"" : ""%> />
				<option label="Korea, (South) Republic of" value="KR"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "KR") ? " selected=\"true\"" : ""%> />
				<option label="Kosovo" value="KV"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "KV") ? " selected=\"true\"" : ""%> />
				<option label="Kuwait" value="KW"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "KW") ? " selected=\"true\"" : ""%> />
				<option label="Kyrgyzstan" value="KG"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "KG") ? " selected=\"true\"" : ""%> />
				<option label="Lao People's Democ. Rep." value="LA"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "LA") ? " selected=\"true\"" : ""%> />
				<option label="Latvia" value="LV"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "LV") ? " selected=\"true\"" : ""%> />
				<option label="Lebanon" value="LB"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "LB") ? " selected=\"true\"" : ""%> />
				<option label="Lesotho" value="LS"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "LS") ? " selected=\"true\"" : ""%> />
				<option label="Liberia" value="LR"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "LR") ? " selected=\"true\"" : ""%> />
				<option label="Libyan Arab Jamahiriya" value="LY"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "LY") ? " selected=\"true\"" : ""%> />
				<option label="Liechtenstein" value="LI"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "LI") ? " selected=\"true\"" : ""%> />
				<option label="Lithuania" value="LT"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "LT") ? " selected=\"true\"" : ""%> />
				<option label="Luxembourg" value="LU"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "LU") ? " selected=\"true\"" : ""%> />
				<option label="Macao, (China)" value="MO"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "MO") ? " selected=\"true\"" : ""%> />
				<option label="Macedonia, TFYR" value="MK"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "MK") ? " selected=\"true\"" : ""%> />
				<option label="Madagascar" value="MG"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "MG") ? " selected=\"true\"" : ""%> />
				<option label="Malawi" value="MW"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "MW") ? " selected=\"true\"" : ""%> />
				<option label="Malaysia" value="MY"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "MY") ? " selected=\"true\"" : ""%> />
				<option label="Maldives" value="MV"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "MV") ? " selected=\"true\"" : ""%> />
				<option label="Mali" value="ML"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "ML") ? " selected=\"true\"" : ""%> />
				<option label="Malta" value="MT"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "MT") ? " selected=\"true\"" : ""%> />
				<option label="Man, Isle of" value="IM"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "IM") ? " selected=\"true\"" : ""%> />
				<option label="Marshall Islands" value="MH"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "MH") ? " selected=\"true\"" : ""%> />
				<option label="Martinique (FR)" value="MQ"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "MQ") ? " selected=\"true\"" : ""%> />
				<option label="Mauritania" value="MR"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "MR") ? " selected=\"true\"" : ""%> />
				<option label="Mauritius" value="MU"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "MU") ? " selected=\"true\"" : ""%> />
				<option label="Mayotte (FR)" value="YT"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "YT") ? " selected=\"true\"" : ""%> />
				<option label="Mexico" value="MX"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "MX") ? " selected=\"true\"" : ""%> />
				<option label="Micronesia, Fed. States of" value="FM"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "FM") ? " selected=\"true\"" : ""%> />
				<option label="Moldova, Republic of" value="MD"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "MD") ? " selected=\"true\"" : ""%> />
				<option label="Monaco" value="MC"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "MC") ? " selected=\"true\"" : ""%> />
				<option label="Mongolia" value="MN"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "MN") ? " selected=\"true\"" : ""%> />
				<option label="Montenegro" value="CS"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "CS") ? " selected=\"true\"" : ""%> />
				<option label="Montserrat" value="MS"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "MS") ? " selected=\"true\"" : ""%> />
				<option label="Morocco" value="MA"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "MA") ? " selected=\"true\"" : ""%> />
				<option label="Mozambique" value="MZ"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "MZ") ? " selected=\"true\"" : ""%> />
				<option label="Myanmar (ex-Burma)" value="MM"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "MM") ? " selected=\"true\"" : ""%> />
				<option label="Namibia" value="NA"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "NA") ? " selected=\"true\"" : ""%> />
				<option label="Nauru" value="NR"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "NR") ? " selected=\"true\"" : ""%> />
				<option label="Nepal" value="NP"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "NP") ? " selected=\"true\"" : ""%> />
				<option label="Netherlands" value="NL"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "NL") ? " selected=\"true\"" : ""%> />
				<option label="Netherlands Antilles" value="AN"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "AN") ? " selected=\"true\"" : ""%> />
				<option label="New Caledonia" value="NC"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "NC") ? " selected=\"true\"" : ""%> />
				<option label="New Zealand" value="NZ"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "NZ") ? " selected=\"true\"" : ""%> />
				<option label="Nicaragua" value="NI"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "NI") ? " selected=\"true\"" : ""%> />
				<option label="Niger" value="NE"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "NE") ? " selected=\"true\"" : ""%> />
				<option label="Nigeria" value="NG"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "NG") ? " selected=\"true\"" : ""%> />
				<option label="Niue" value="NU"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "NU") ? " selected=\"true\"" : ""%> />
				<option label="Norfolk Island" value="NF"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "NF") ? " selected=\"true\"" : ""%> />
				<option label="Northern Mariana Islands" value="MP"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "MP") ? " selected=\"true\"" : ""%> />
				<option label="Norway" value="NO"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "NO") ? " selected=\"true\"" : ""%> />
				<option label="Oman" value="OM"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "OM") ? " selected=\"true\"" : ""%> />
				<option label="Pakistan" value="PK"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "PK") ? " selected=\"true\"" : ""%> />
				<option label="Palau" value="PW"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "PW") ? " selected=\"true\"" : ""%> />
				<option label="Palestinian Territory" value="PS"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "PS") ? " selected=\"true\"" : ""%> />
				<option label="Panama" value="PA"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "PA") ? " selected=\"true\"" : ""%> />
				<option label="Papua New Guinea" value="PG"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "PG") ? " selected=\"true\"" : ""%> />
				<option label="Paraguay" value="PY"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "PY") ? " selected=\"true\"" : ""%> />
				<option label="Peru" value="PE"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "PE") ? " selected=\"true\"" : ""%> />
				<option label="Philippines" value="PH"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "PH") ? " selected=\"true\"" : ""%> />
				<option label="Pitcairn Island" value="PN"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "PN") ? " selected=\"true\"" : ""%> />
				<option label="Poland" value="PL"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "PL") ? " selected=\"true\"" : ""%> />
				<option label="Portugal" value="PT"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "PT") ? " selected=\"true\"" : ""%> />
				<option label="Puerto Rico" value="PR"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "PR") ? " selected=\"true\"" : ""%> />
				<option label="Qatar" value="QA"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "QA") ? " selected=\"true\"" : ""%> />
				<option label="Reunion (FR)" value="RE"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "RE") ? " selected=\"true\"" : ""%> />
				<option label="Romania" value="RO"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "RO") ? " selected=\"true\"" : ""%> />
				<option label="Russia (Russian Fed.)" value="RU"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "RU") ? " selected=\"true\"" : ""%> />
				<option label="Rwanda" value="RW"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "RW") ? " selected=\"true\"" : ""%> />
				<option label="S Pierre & Miquelon(FR)" value="PM"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "PM") ? " selected=\"true\"" : ""%> />
				<option label="S Vincent & Grenadines" value="VC"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "VC") ? " selected=\"true\"" : ""%> />
				<option label="S.George & S.Sandwich" value="GS"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "GS") ? " selected=\"true\"" : ""%> />
				<option label="Sahara, Western" value="EH"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "EH") ? " selected=\"true\"" : ""%> />
				<option label="Saint Barthelemy (FR)" value="BL"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "BL") ? " selected=\"true\"" : ""%> />
				<option label="Saint Helena (UK)" value="SH"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "SH") ? " selected=\"true\"" : ""%> />
				<option label="Saint Kitts and Nevis" value="KN"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "KN") ? " selected=\"true\"" : ""%> />
				<option label="Saint Lucia" value="LC"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "LC") ? " selected=\"true\"" : ""%> />
				<option label="Saint Martin (FR)" value="MF"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "MF") ? " selected=\"true\"" : ""%> />
				<option label="Samoa" value="WS"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "WS") ? " selected=\"true\"" : ""%> />
				<option label="San Marino" value="SM"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "SM") ? " selected=\"true\"" : ""%> />
				<option label="Sao Tome and Principe" value="ST"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "ST") ? " selected=\"true\"" : ""%> />
				<option label="Saudi Arabia" value="SA"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "SA") ? " selected=\"true\"" : ""%> />
				<option label="Senegal" value="SN"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "SN") ? " selected=\"true\"" : ""%> />
				<option label="Serbia" value="RS"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "RS") ? " selected=\"true\"" : ""%> />
				<option label="Seychelles" value="SC"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "SC") ? " selected=\"true\"" : ""%> />
				<option label="Sierra Leone" value="SL"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "SL") ? " selected=\"true\"" : ""%> />
				<option label="Singapore" value="SG"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "SG") ? " selected=\"true\"" : ""%> />
				<option label="Slovakia" value="SK"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "SK") ? " selected=\"true\"" : ""%> />
				<option label="Slovenia" value="SI"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "SI") ? " selected=\"true\"" : ""%> />
				<option label="Solomon Islands" value="SB"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "SB") ? " selected=\"true\"" : ""%> />
				<option label="Somalia" value="SO"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "SO") ? " selected=\"true\"" : ""%> />
				<option label="South Africa" value="ZA"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "ZA") ? " selected=\"true\"" : ""%> />
				<option label="South Sudan" value="SS"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "SS") ? " selected=\"true\"" : ""%> />
				<option label="Spain" value="ES"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "ES") ? " selected=\"true\"" : ""%> />
				<option label="Sri Lanka (ex-Ceilan)" value="LK"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "LK") ? " selected=\"true\"" : ""%> />
				<option label="Sudan" value="SD"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "SD") ? " selected=\"true\"" : ""%> />
				<option label="Suriname" value="SR"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "SR") ? " selected=\"true\"" : ""%> />
				<option label="Svalbard & Jan Mayen Is." value="SJ"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "SJ") ? " selected=\"true\"" : ""%> />
				<option label="Swaziland" value="SZ"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "SZ") ? " selected=\"true\"" : ""%> />
				<option label="Sweden" value="SE"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "SE") ? " selected=\"true\"" : ""%> />
				<option label="Switzerland" value="CH"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "CH") ? " selected=\"true\"" : ""%> />
				<option label="Syrian Arab Republic" value="SY"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "SY") ? " selected=\"true\"" : ""%> />
				<option label="Taiwan" value="TW"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "TW") ? " selected=\"true\"" : ""%> />
				<option label="Tajikistan" value="TJ"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "TJ") ? " selected=\"true\"" : ""%> />
				<option label="Tanzania, United Rep. of" value="TZ"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "TZ") ? " selected=\"true\"" : ""%> />
				<option label="Thailand" value="TH"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "TH") ? " selected=\"true\"" : ""%> />
				<option label="Timor-Leste (East Timor)" value="TL"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "TL") ? " selected=\"true\"" : ""%> />
				<option label="Togo" value="TG"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "TG") ? " selected=\"true\"" : ""%> />
				<option label="Tokelau" value="TK"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "TK") ? " selected=\"true\"" : ""%> />
				<option label="Tonga" value="TO"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "TO") ? " selected=\"true\"" : ""%> />
				<option label="Trinidad & Tobago" value="TT"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "TT") ? " selected=\"true\"" : ""%> />
				<option label="Tunisia" value="TN"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "TN") ? " selected=\"true\"" : ""%> />
				<option label="Turkey" value="TR"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "TR") ? " selected=\"true\"" : ""%> />
				<option label="Turkmenistan" value="TM"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "TM") ? " selected=\"true\"" : ""%> />
				<option label="Turks and Caicos Is." value="TC"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "TC") ? " selected=\"true\"" : ""%> />
				<option label="Tuvalu" value="TV"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "TV") ? " selected=\"true\"" : ""%> />
				<option label="Uganda" value="UG"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "UG") ? " selected=\"true\"" : ""%> />
				<option label="Ukraine" value="UA"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "UA") ? " selected=\"true\"" : ""%> />
				<option label="United Arab Emirates" value="AE"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "AE") ? " selected=\"true\"" : ""%> />
				<option label="United Kingdom" value="UK"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "UK") ? " selected=\"true\"" : ""%> />
				<option label="United States" value="US"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "US") ? " selected=\"true\"" : ""%> />
				<option label="Uruguay" value="UY"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "UY") ? " selected=\"true\"" : ""%> />
				<option label="US Minor Outlying Isl." value="UM"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "UM") ? " selected=\"true\"" : ""%> />
				<option label="Uzbekistan" value="UZ"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "UZ") ? " selected=\"true\"" : ""%> />
				<option label="Vanuatu" value="VU"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "VU") ? " selected=\"true\"" : ""%> />
				<option label="Vatican (Holy See)" value="VA"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "VA") ? " selected=\"true\"" : ""%> />
				<option label="Venezuela" value="VE"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "VE") ? " selected=\"true\"" : ""%> />
				<option label="Viet Nam" value="VN"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "VN") ? " selected=\"true\"" : ""%> />
				<option label="Virgin Islands, British" value="VG"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "VG") ? " selected=\"true\"" : ""%> />
				<option label="Virgin Islands, U.S." value="VI"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "VI") ? " selected=\"true\"" : ""%> />
				<option label="Wallis and Futuna" value="WF"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "WF") ? " selected=\"true\"" : ""%> />
				<option label="Western Sahara" value="EH"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "EH") ? " selected=\"true\"" : ""%> />
				<option label="Yemen" value="YE"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "YE") ? " selected=\"true\"" : ""%> />
				<option label="Zambia" value="ZM"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "ZM") ? " selected=\"true\"" : ""%> />
				<option label="Zimbabwe" value="ZW"<%=account != null && StringUtils.equalsIgnoreCase(account.getCountry(), "ZW") ? " selected=\"true\"" : ""%> />
			</aui:select>
			<aui:button type="submit"
				value="<%=account != null ? \"update\" : \"create\"%>" />
		</aui:column>
	</aui:layout>
</aui:form>
